/**
 *
 * @file CFDPostOperatorsImport.h
 * @brief 打开事件操作器
 * @author BaGuijun (baguijun@163.com)
 * @date 2024-09-04
 *
 */
#ifndef _CFDPostOperatorsImport_H_
#define _CFDPostOperatorsImport_H_

#include "FITK_Kernel/FITKCore/FITKActionOperator.h"
#include "FITK_Kernel/FITKCore/FITKOperatorRepo.h"
#include "FITK_Kernel/FITKCore/FITKThreadTask.h"
#include "CFDPostOperatorsBase.h"


namespace OperModel {
    /**
         * @brief 打开事件操作器
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-09-04
         */
    class CFDPostOperatorsModelAPI CFDPostOperatorsImport: public Core::FITKActionOperator {
        Q_OBJECT;
      public:
        /**
             * @brief Construct a new Operators Open object
             * @author BaGuijun (baguijun@163.com)
             * @date 2024-09-04
             */
        explicit CFDPostOperatorsImport();
        /**
             * @brief Destroy the Operators Open object
             * @author BaGuijun (baguijun@163.com)
             * @date 2024-09-04
             */
        ~CFDPostOperatorsImport()  = default;
        /**
             * @brief ui事件
             * @return true 成功
             * @return false 失败
             * @author BaGuijun (baguijun@163.com)
             * @date 2024-09-04
             */
        virtual bool execGUI() override;
        /**
             * @brief 执行结果处理
             * @return true 成功
             * @return false 失败
             * @author BaGuijun (baguijun@163.com)
             * @date 2024-09-04
             */
        virtual bool execProfession() override;
        // 清空所有在现实的3D内容
        bool clear();
      private slots:
        ;
        /**
             * @brief    文件导入槽函数
             * @param[i] isOK       是否成功
             * @param[i] objID      数据对象id
             * @author   BaGuijun (baguijun@163.com)
             * @date     2024-09-07
             */
        void slotImportFinish(bool isOK, int objID);


        // void onActionMTriggered();
    };

    /**
             * @brief 导入文件读取线程
             * @author BaGuijun (baguijun@163.com)
             * @date 2024-08-14
             */
    class ImportReadThread : public Core::FITKThreadTask {
        Q_OBJECT;
      public:
        /**
             * @brief Construct a new Import Read Thread object
             * @author BaGuijun (baguijun@163.com)
             * @date 2024-08-14
             */
        ImportReadThread() = default;
        /**
             * @brief Destroy the Import Read Thread object
             * @author BaGuijun (baguijun@163.com)
             * @date 2024-08-14
             */
        ~ImportReadThread() = default;
        /**
             * @brief 执行函数
             * @author BaGuijun (baguijun@163.com)
             * @date 2024-08-14
             */
        void run();
      signals:
        ;
        /**
             * @brief 导入完成信号
             * @author BaGuijun (baguijun@163.com)
             * @date 2024-08-14
             */
        void sigImportFinish(bool, int);
      public:
        /**
             * @brief 文件名称
             * @author BaGuijun (baguijun@163.com)
             * @date 2024-08-14
             */
        QString _fileName = "";
    };

    // 根据按钮的ObjectName进行注册按钮事件
#ifndef _RegisteractionCFDPostOpen__
    #define _RegisteractionCFDPostOpen__
    Register2FITKOPeratorRepo(actionCFDPostOpen, CFDPostOperatorsImport);
    Register2FITKOPeratorRepo(actionCFD3DManagerClear, CFDPostOperatorsImport);
#endif
}

#endif
